package pool

import (
	"github.com/redis/go-redis/v9"
	"user-center/config"
)

var re *redis.Client

func init() {
	host := config.GetConfig().Redis.Host
	port := config.GetConfig().Redis.Port
	password := config.GetConfig().Redis.Password
	dbNum := config.GetConfig().Redis.DB
	re = redis.NewClient(&redis.Options{
		Addr:     host + ":" + port,
		Password: password,
		DB:       dbNum,
	})
}

func GetRedis() *redis.Client {
	return re
}
